package com.ha7419x.rest;

import com.ha7419x.vo.Company;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CompanyRest {

    @RequestMapping(value = "/company/get/{title}", method = RequestMethod.GET)
    @HystrixCommand//如果需要进行性能监控 必须要有次注解
    public Object get(@PathVariable("title") String title){
        Company company = new Company();
        company.setTitle(title);
        company.setNote("哈哈哈哈哈");
        return company;
    }

}
